<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查看开店记录</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>res/hjt/layui/css/layui.css" media="all">
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>查看开店记录</legend>
	</fieldset>
	<div class="layui-form-item">
		<div class="layui-inline">
			<button class="layui-btn">查看</button>
		</div>
		<div class="layui-inline">
			<div class="layui-input-inline">
				<input type="number" name="merchantPhone" id="merchantPhone" lay-verify="required|phone"
					autocomplete="off" class="layui-input" placeholder="请输入手机号码">
			</div>
		</div>
	</div>
	<div style="display:none;" id="table">
		<table class="layui-hide" id="fodMerchant" lay-filter="demo"></table>
	</div>
	
	<script src="<%=basePath %>res/hjt/layui/layui.js"></script>
	<script>
layui.use(['laydate', 'laypage', 'layer', 'table', 'upload', 'element'], function(){
	  var laydate = layui.laydate //日期
	  ,laypage = layui.laypage //分页
	  layer = layui.layer //弹层
	  ,table = layui.table //表格
	  ,upload = layui.upload //上传
	  ,element = layui.element; //元素操作
	 
	  var $ = layui.$;
	  
	  //监听Tab切换
	  element.on('tab(demo)', function(data){
	    layer.msg('切换了：'+ this.innerHTML);
	    console.log(data);
	  });
	 
	//执行一个 table 实例
	  table.render({
	     elem: '#fodMerchant'
	    ,width:1064
	    ,url: '<%=basePath %>merchant/findAlls' //数据接口
	    ,page: true //开启分页
	    ,method:'post'
	    ,cols: [[ //表头
	    	 {type:'checkbox', fixed: 'left'}
		      ,{field: 'merchantName', title: '店铺名称', width:120, fixed: 'left'}
		      ,{field: 'manUser', title: '店长账号', width:120}
		      ,{field: 'merchantPhone', title: '商家电话', width:120}
		      ,{field: 'manPwd', title: '店长密码', width:120}
		      ,{field: 'typeName', title: '餐馆类型', width: 120}
		      ,{field: 'manCardid', title: '身份证号', width:120}
		      ,{field: 'merchantSite', title: '餐馆地址', width:120}
		      ,{field: 'shenhe', title: '是否审核', width:120}
		      ,{fixed: 'right',title: '详细地址', width: 165, align:'center', field:'merchantCredit'}
	    ]]
	  	,id: 'testReload'
	  });
	 
	  $('.layui-btn').on('click', function(){
		  	$("#table").attr("style","display:block;")
			 var merchantPhone = $('#merchantPhone');
			 //执行重载
		     table.reload('testReload', {
		       page: {
		         curr: 1 //重新从第 1 页开始
		       }
		       ,where: {
		    	   merchantPhone: merchantPhone.val()
		       }
		     });
		  });
	
	});
	
</script>
</body>
</html>